<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>自动化代码生成</title>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <link th:href="@{/bootstrap/bootstrap.css}" href="../static/bootstrap/bootstrap.css" rel="stylesheet"/>
    <link th:href="@{/bootstrap/bootstrap-theme.css}" href="../static/bootstrap/bootstrap-theme.css"
          rel="stylesheet"/>
    <script th:src="@{/js/jquery.min.js}" src="../static/js/jquery.min.js"></script>
    <script th:src="@{/js/bootstrap.min.js}" src="../static/js/bootstrap.min.js"></script>
    <script type="text/javascript">
        $(function(){
            $("#submit").click(function () {
                $.post("/system/login/login",$("#loginForm").serialize(), function (data) {
                        if(data.code=="0"){
                            window.location.href = "/template";
                        }else if(data.code=="1"){
                            $("#tick").text(data.message).css("color", "red");
                        }
                })
            });
        });
    </script>
</head>
<body>
<div class="container">
    <div class="row">
        <form class="form-horizontal" id="loginForm">
        <div class="col-md-4">
            <div class="panel panel-primary">
                <div class="panel-heading text-center">
                    <span class="panel-title">用户信息</span>
                </div>
                <div class="form-group">
                    <label for="username" class="col-sm-3 control-label" style="color: red">账&nbsp;号:</label>
                    <div class="col-sm-8">
                        <input type="text" class="form-control" id="username" name="username" placeholder="请输入账号">
                    </div>
                </div>
                <div class="form-group">
                    <label for="password" class="col-sm-3 control-label" style="color: red">密&nbsp;码:</label>
                    <div class="col-sm-8">
                        <input type="password" class="form-control" id="password" name="password"
                               placeholder="请输入密码">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-10 control-label" style="color:red;text-align: center"
                           id="tick">&nbsp;</label>
                </div>
                <div class="form-group" >
                    <div class="col-sm-8">
                        <button type="button" id="submit" class="btn btn-default">登录</button>
                    </div>
                </div>
                <div class="panel-footer text-right">
                    <span class="panel-title">quantdo@2108</span>
                </div>
            </div>
        </div>
        </form>
    </div>
</div>



</body>
</html>